<template>
	<view class="search-container">
		<input class="search" type="text" v-model="keywords" placeholder="搜索" />
		<u-icon class="icon" name="search" @click="onClick"></u-icon>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keywords: ''
			};
		},
		methods: {
			onClick() {
				this.$emit('onClick', this.keywords)
			}
		}
	}
</script>

<style lang="scss">
	.search-container {
		width: 680rpx;
		height: 76rpx;
		margin: 0 auto;
		position: relative;
	}
	.search {
		width: 100%;
		height: 100%;
		background: #EEEEEE;
		border: 1rpx solid #EEEEEE;
		border-radius: 20rpx;
		margin: 0 auto;
		padding: 0 64rpx 0 24rpx;
		box-sizing: border-box;
	}
	.icon {
		position: absolute;
		top: 50%;
		right: 0;
		transform: translate(-100%, -50%);
	}
</style>
